package com.qishuihe.running.application.instance;

import com.alibaba.fastjson.JSON;
import com.qishuihe.basedomain.infrastructure.aspect.LogAnnotation;
import com.qishuihe.baseinterface.basevo.vo.ResultVO;
import com.qishuihe.designinterface.template.ITemplateSchema;
import com.qishuihe.designinterface.template.dto.QuerySchemaParam;
import com.qishuihe.designinterface.template.vo.TemplateConfigVO;
import com.qishuihe.outbound.user.IUser;
import com.qishuihe.runninginterface.instance.IInstance;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/Instance")
@Api(tags = "流程模板配置相关服务")
public class InstanceControl implements IInstance {

    @Autowired
    private ITemplateSchema templateSchema;

    @Autowired
    private IUser user;

    @Override
    @GetMapping(value = "/queryInstance", name = "查询创建模板")
//    @LogAnnotation
    public ResultVO queryInstance() {
        QuerySchemaParam querySchemaParam = new QuerySchemaParam();
        querySchemaParam.setTemplateID(10086);
        TemplateConfigVO templateConfigVO = templateSchema.querySchema(querySchemaParam);
        ResultVO resultVO = new ResultVO();
        resultVO.setObj(templateConfigVO.getTemplateCode());
//        resultVO = user.queryUserById(1561748276262244354L);
        return resultVO;
    }


}
